package nodes.binary;

import nodes.AbstractNode;
import nodes.ConstantNode;
import model.Model;

/**
 * Used for representing greater than in the expression tree
 * 
 * @author Andrew Patterson
 */
public class GreaterNode extends AbstractBinaryNode
{

    public GreaterNode (Model model)
    {
        super(model);
        myName = syntaxBundle.getString("greater_than_label");
    }


    public AbstractNode evaluate ()
    {
        if(myLeft.evaluate().getValue() > myRight.evaluate().getValue()) return new ConstantNode(1);
        else return new ConstantNode(0);
    }

}
